<div id="edit-title">更新供应商信息</div>
<div>
	<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST">
		<input type="hidden" name="rand" value="<?php echo $form['rand']; ?>" />
		<input type="hidden" name="supplier_id" value="<?php echo $form['supplier_id']; ?>" />
		<div class="edit-name">供应商代码</div>
		<div class="edit-text"><input disabled type="text" value="<?php echo $form['supplier_code'] ?>" /></div>
		<div class="edit-name">供应商 <?php echo form_error('supplier_name', '<span class="error">', '</span>'); ?></div>
		<div class="edit-text"><input type="text" name="supplier_name" value="<?php echo isset($form['supplier_name'])?$form['supplier_name']:set_value('supplier_name') ?>" /></div>
		<div class="edit-name">优先级</div>
		<div class="edit-select">
			<select name="supplier_priority">
			<?php foreach ($priority as $p) { ?>
				<option value="<?php echo $p['id'] ?>" <?php if(isset($form['supplier']['supplier_priority'])&&$form['supplier']['supplier_priority']==$p['id']){echo 'selected';}else{echo set_select('supplier_priority', $p['id']);} ?>><?php echo $p['name'] ?></option>
			<?php } ?>
			</select>
		</div>
		<div class="edit-name">联系方式 <?php echo form_error('supplier_contact', '<span class="error">', '</span>'); ?></div>
		<div class="edit-text"><input type="text" name="supplier_contact" value="<?php echo isset($form['supplier_contact'])?$form['supplier_contact']:set_value('supplier_contact') ?>" /></div>
		<div class="edit-name">联系地址 <?php echo form_error('supplier_location', '<span class="error">', '</span>'); ?></div>
		<div class="edit-text"><input type="text" name="supplier_location" value="<?php echo isset($form['supplier_location'])?$form['supplier_location']:set_value('supplier_location') ?>" /></div>
		<div class="clear"></div>
		<div class="edit-submit"><input type="submit" value="更新" /><?php if (isset($form['result'])) { ?><div class="edit-result"><?php echo $form['result']; ?></div><?php } ?></div>
	</form>
</div>
<script type="text/javascript">
$(function(){
	$('.option').bind('click', function(){form.select._click($(this))});
})
</script>